<template>
	<view class="my-search-container" :style="{'background-color': bgcolor}">
		<view class="my-search-box" :style="{'border-radius': radius + 'rpx'}" @click="searchBoxHandler">
			<!-- 使用uni-ui 提供的图标 -->
			<uni-icons type="search" size="19"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>


<script>
	export default{
		props: {
			// 背景颜色
				bgcolor: {
					type: String,
					default: '#C00000'
				},
				
			// 圆角尺寸
				radius: {
					type: Number,
					default: 36 //px
				}
		},
		
		data() {
			return {
				internalHeight: 50
				
			}
		},
		
		methods: {
			searchBoxHandler() {
				this.$emit('click')
			}
		},
		
		computed: {
		    height() {
		      return this.internalHeight;
		    }
		  }
	}
</script>


<style>
	.my-search-container {
		height: 100rpx;
/* 		background-color: #C00000; */
		display: flex;
		align-items: center;
		padding: 0 20rpx;
	}
	.my-search-box {
		height: 72rpx;
		background-color: white;
/* 		border-radius: 36rpx; */
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.placeholder {
		font-size: 30rpx;
		margin-left: 10rpx;
	}
</style>
